<template>
  <div class="page">
    <!-- 导航 开始 -->
    <nav-bar title="特惠商品"></nav-bar>
    <!-- 导航 end -->

    <div class="case_list goods_list">
      <template v-if="goodsList && goodsList.length">
        <Goods v-for="(item,index) in goodsList" :key="index" :info="item"></Goods>
      </template>
      <no-data v-else></no-data>
    </div>

  </div>
</template>
  <script>
import Goods from "@/components/goods/index.vue";
import { GET_HOSPITAL_GOODS } from "@/http/interface";
export default {
  components: {
    Goods,
  },
  data() {
    return {
      goodsList: [],
    };
  },
  head() {
    return {
      link: [
        {
          ref: "canonical",
          href: `${this.$domain}/hospital/goods`,
        },
      ],
    };
  },
  async asyncData({ query, $axios }) {
    let params = { id: query.id };
    let res = await $axios.get(GET_HOSPITAL_GOODS, { params: params });
    let goodsList =  res.data || [];
    return {
      goodsList,
    };
  },
};
</script>
  <style lang="less" scoped>
@import "/assets/styles/hospital/case.less";
</style>